package cn.wizzer.app.user.modules.models.enums;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 支付通道
 */

public enum  ChannelEnum {
    //
    MANUAL("手动",0),
    ALI_PAY("支付宝",1),
    WE_CHAT_PAY("微信",2),
    UNION_PAY("银联",3),
    ;
    final public String NAME;
    final public Integer VALUE;


    ChannelEnum(String name,Integer val) {
        NAME = name;
        VALUE = val;
    }

    public String getNAME() {
        return NAME;
    }

    public Integer getVALUE() {
        return VALUE;
    }

    public static List toList() {
        List<Map<String, Object>> list = new ArrayList<>();
        for (ChannelEnum channelEnum : ChannelEnum.values()) {
            Map<String, Object> map = new HashMap<>();
            map.put("name", channelEnum.getNAME());
            map.put("val", channelEnum);
            list.add(map);
        }
        return list;
    }
}
